package core.ui.demo;

import javafx.collections.ObservableList;
import javafx.scene.Node;
import javafx.scene.control.RadioButton;
import javafx.scene.control.ToggleGroup;
import javafx.scene.layout.VBox;
/**
 * @author 李瑜
 * @since JavaFX 8.0
 */
public class DemoRadioButton
{
	public static VBox getRadioButton()
	{
		VBox box = new VBox();
		box.setSpacing(5);
		ObservableList<Node> boxs = box.getChildren();
		
		ToggleGroup group = new ToggleGroup();
		RadioButton button1 = new RadioButton("单选按钮1");
		RadioButton button2 = new RadioButton("单选按钮2");
		RadioButton button3 = new RadioButton("单选按钮3");
		RadioButton button4 = new RadioButton("单选按钮4");
		RadioButton button5 = new RadioButton("单选按钮5");
		
		button1.setSelected(true);
		button1.setToggleGroup(group);
		button2.setToggleGroup(group);
		button3.setToggleGroup(group);
		button4.setToggleGroup(group);
		button5.setToggleGroup(group);
		
		boxs.add(button1);
		boxs.add(button2);
		boxs.add(button3);
		boxs.add(button4);
		boxs.add(button5);
		
		return box;
	}
}
